package com.ftaillefer.berkeydbexplore;

import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.PrimaryKey;
import com.sleepycat.persist.model.SecondaryKey;

import java.util.Date;

@Entity
class BlogPost {

    private @PrimaryKey
    String title;
    private String text;
   // private  @SecondaryKey(relate=)
    Date postingDate;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }


    public Date getPostingDate() {
        return postingDate;
    }

    public void setPostingDate(Date postingDate) {
        this.postingDate = postingDate;
    }


    public BlogPost(String title, String text) {
        this.title = title;
        this.text = text;
        this.postingDate = new Date();
    }

    BlogPost() {
    }

    BlogPost(String title) {
        this.title = title;
    }
}